//
//  PPFavouritePictureModel.m
//  
//
//  Created by GaoYongyue on 16/9/16.
//
//

#import "PPFavouritePictureModel.h"

@implementation PPFavouritePictureModel

// Insert code here to add functionality to your managed object subclass

+ (instancetype)existingAlbumTagForPictureID:(NSNumber *)pictureID inAlbum:(NSNumber *)albumID
{
    PPFavouritePictureModel *picture = [self find:@{@"albumID" : albumID, @"pictureID" : pictureID}];

    if(picture == nil) {
        picture = [PPFavouritePictureModel create];
        picture.albumID = albumID;
        picture.pictureID = pictureID;
        [picture.managedObjectContext saveContext];
    }

    return picture;
}
@end
